/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * NuGat-API named Chameleon developed by Simon De Baets to Verimag.
 *
 */


package chameleon.model.NuGatStructure.prop;

import chameleon.model.NuGatStructure.utils.Node;
import chameleon.model.NuGatStructure.utils.Expression;
import chameleon.model.NuGatStructure.fsm.SexpFsm;
import chameleon.model.NuGatStructure.fsm.BddFsm;
import chameleon.gameSolver.NuGat.NuGatInterface;
import chameleon.model.NuGatStructure.NuGatStructure;
import com.sun.jna.Pointer;

/**
 * This class is a wrapper to the C struct Prop.c
 *
 * @author simon
 */
public class Prop extends NuGatStructure{

    public Prop(Pointer prop, NuGatInterface nugat){
        super (prop, nugat);
    }

    public Prop(Node Expr, int propType, NuGatInterface nugat){
        super(nugat.Prop_create_partial(Expr.ptr(), propType),nugat);
    }
    
    
    /**
     * Return the string representation of the property.
     * @return
     */
    public String getTypeAsString(){
        return nugat_.Prop_get_type_as_string(this.ptr());
    }

    /**
     * Return the type of the property (on tag format).
     *
     * @return Prop_Type
     */
    public int getType(){
        return nugat_.Prop_get_type(this.ptr());
    }

    /**
     *
     * @return Expr_ptr
     */

    public Expression getExprCore(){
        return new Expression(nugat_.Prop_get_expr_core(this.ptr()),nugat_);
    }


    public String toString (){
        return nugat_.Prop_get_text(this.ptr());
    }
    
    public int getStatus(){
        return nugat_.Prop_get_status(this.ptr());
    }

    public void setBddFsm(BddFsm fsm){
        nugat_.Prop_set_bdd_fsm(this.ptr(), fsm.ptr());
    }
    
    public void setScalarSexpFsm(SexpFsm fsm){
        nugat_.Prop_set_scalar_sexp_fsm(this.ptr(), fsm.ptr());
    }
}
